#include <bits/stdc++.h>
using namespace std;
int n;
const int N = 1e6 + 10;
bool st[N];
int prime[N], cnt;

void get_prime(int n) {
	for (int i = 2; i <= n; ++i) {
		if (st[i]) {
			continue;
		}
		prime[cnt++] = i;
		for (int j = i + i; j <= n; j += i) {
			st[j] = true;
		}
	}
}

int main() {
	cin >> n;
	get_prime(n);
	cout << cnt;
	return 0;
}